<template>
  <div class="home">
    <button type="button" @click="i--">-</button>
    <span>{{ i }}</span>
    <button type="button" @click="i++">+</button><br>
    输入框
    <input type="text" v-model="username"/>
    <button type="button" @click="dianji()">发布</button>
    <ul v-for="(item,i) in arr" :key="i">
      <li>{{item}}</li>
      </ul>
      <div>
        <h1>床前明月光，疑是地上霜</h1>
        <h2>啊啊啊</h2>
        <h3>美女</h3>
        <h4>君不见黄河之水天上来</h4>
        <h5>一剑寒光照九州</h5>
      </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      i:0,
       username:"",
       arr:[],
    };

  },
  methods:{
    dianji(){
      
     this.arr.push(this.username)
    }
  }
};
</script>

<style>
button {
  margin-left: 20px;
  width: 100px;
  height: 50px;
}
</style>